package TestSync;


public class TestSync implements Runnable {

    Timer timer = new Timer();

    public static void main(String[] args) {
        TestSync test = new TestSync();
        Thread t1 = new Thread(test);
        Thread t2 = new Thread(test);
        t1.getName();
        t2.getName();
        t1.start();
        t2.start();
    }


    @Override
    public void run() {
        timer.add(Thread.currentThread().getName());
    }
}


